package edu.sctu.wulixia.month6.day20150608;

/**
 * Created by user05 on 2015/6/8.
 */
//利用Runnable模拟售票

public class TicketNumber implements Runnable{
    int ticketNumber = 5;//票数为五张

    @Override
    public void run() {

        while(ticketNumber > 0){
            ticketNumber--;//剩余票数

            System.out.println(
                    Thread.currentThread().getName()+
                            "卖出1张票，剩余票数为：" + ticketNumber);
        }
    }
}
